home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3211 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.6 KB

  1. Path: mail2news.demon.co.uk!hpl3sn03.cern.ch
  2. From: Dan Pop <danpop@mail.cern.ch>
  3. Newsgroups: comp.sys.sun.admin,comp.sys.unix,comp.lang.c
  4. Subject: Re: Yet more GCC 2.7.2 problems (SunOS 4). Memmove is missing.
  5. Date: Sat, 27 Jan 1996 01:21:43 +0100
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <9601270021.AA09981@dxmint.cern.ch>
  8. References: <310959EB.41C6@llnl.gov>
  9. X-NNTP-Posting-Host: hpl3sn03.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11. X-Mail2News-Path: dxmint.cern.ch!hpl3sn03.cern.ch
  12.  
  13. Sean Ahern <ahern@llnl.gov> writes:
  14.  
  15. >Just to let you know what OS I'm on, uname -a gives me this:
  16. >SunOS spear.lln 4.1.3_U1 1 sun4c
  17. >
  18. >I've compiled and installed GCC 2.7.2 on this machine, but I've noticed that
  19. >I'm missing something important.  The memmove call is missing, it seems.  I get
  20. >unresolved references when I attempt to compile code that uses memmove.
  21. >
  22. >    gcc -o foo foo.c -ldl
  23. >    ld: Undefined symbol 
  24. >       _memmove 
  25. >
  26. >Looking around the configuration for sun and the source code for gcc would lead
  27. >me to believe that memmove should be in the libgcc.a libraries, but I can't
  28. >seem to find it.  
  29.  
  30. Nope.  It should be in the system's libc.a, but it isn't because the SunOS 4
  31. libraries aren't ANSI compliant.  gcc is only a compiler, it relies on the
  32. system libraries for the standard C and Unix functions.
  33.  
  34. >I also can't seem to find anything mentioning this on the Web
  35. >or in any FAQ.
  36.  
  37. You haven't tried hard enough.
  38.  
  39. >Does anyone know what I might be doing wrong here?
  40.  
  41. Not reading the FAQ before posting.  From the c.l.c FAQ:
  42.  
  43. 13.24:  I'm trying to port this      A: Those routines are variously
  44.         old program.  Why do I          obsolete; you should
  45.         get "undefined external"        instead:
  46.         errors for:
  47.  
  48.         index?                          use strchr.
  49.         rindex?                         use strrchr.
  50.         bcopy?                          use memmove, after
  51.                                         interchanging the first and
  52.                                         second arguments (see also
  53.                                         question 11.25).
  54.         bcmp?                           use memcmp.
  55.         bzero?                          use memset, with a second
  56.                                         argument of 0.
  57.  
  58.         Contrariwise, if you're using an older system which is missing
  59.         the functions in the second column, you may be able to implement
  60.         them in terms of, or substitute, the functions in the first.
  61.  
  62. Note the last paragraph!
  63.  
  64. Dan
  65. -- 
  66. Dan Pop
  67. CERN, CN Division
  68. Email: danpop@mail.cern.ch 
  69. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  70.